import Vue from 'vue'
import VueRouter from 'vue-router'
//引入路由表
import route from './config'
Vue.use(VueRouter)

const routes = route
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
// 导航守卫
// router.beforeEach((to, from, next) => {
//   if (to.path === '/login') {
//     return next()
//   }
//   const tokenstr = window.sessionStorage.getItem('token')
//   if (!tokenstr) {
//     return next('/login')
//   }
//   next()
// })
export default router
